package com.xuexuehai.carrecommand.dao;

import com.xuexuehai.carrecommand.entity.Car;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author xuexuehai
 * @mailBox xuehai.xue@QQ.com
 * @date 2021/8/22 10:04 下午
 */
@Repository
public interface ICarDao extends JpaRepository<Car,Integer> {
    @Query(value = "SELECT COUNT(*),car_factory FROM car_tab GROUP BY car_factory", nativeQuery = true)
    Object[] countCarFactory();
}
